'''
Created on 20.12.2012

@author: felix
'''
from game.player.alpha_beta_player.alpha_beta_framework.heuristic.Heuristic import Heuristic

class MulitpleHeuristics(Heuristic):
    '''
    classdocs
    '''


    def __init__(self):
        Heuristic.__init__(self, 1)
        self.fieldHeuristics = []
        
    def addHeuristic(self, heuristic):
        self.fieldHeuristics.append(heuristic)
    
    def heuristic(self, field, action, color, nextColor, depth):
        heuristic = 0
        for h in self.fieldHeuristics:
            heuristic += h.heuristic(field, action, color, nextColor, depth) * h.weight
        return heuristic